/*
 * This is the action responsible for deleting a private message
 * when the user clicks the delete button on the message page
 */

package airport.forum.action;

//import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.interceptor.ServletRequestAware;
import org.apache.struts2.interceptor.ServletResponseAware;

import com.opensymphony.xwork2.ActionSupport;

import airport.forum.dao.PrivateMessageDAO;

public class DeletePrivateMessageAction  extends ActionSupport implements ServletResponseAware,
ServletRequestAware {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;



	private int pmId;
	
	
	
	protected HttpServletResponse servletResponse;

	@Override
	public void setServletResponse(HttpServletResponse servletResponse) {
		this.servletResponse = servletResponse;
	}

	protected HttpServletRequest servletRequest;

	@Override
	public void setServletRequest(HttpServletRequest servletRequest) {
		this.servletRequest = servletRequest;
	}

	
	public String execute() {
		

		PrivateMessageDAO dao = new PrivateMessageDAO();

		dao.deletePm(pmId);

		return "success";
	}


	public int getPmId() {
		return pmId;
	}


	public void setPmId(int pmId) {
		this.pmId = pmId;
	}
}
